import { createRouter, createWebHashHistory } from 'vue-router'
// import useUserStore from '../stores/user.js'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/IndexPage.vue'),
    children: [
      {
        path: '/crm',
        name: 'crm',
        children: [
          {
            path: '/leads',
            name: 'leads',
            children: [
              {
                path: '/leads',
                name: 'leadsPage',
                component: () =>
                  import('@/views/crm/leads/LeadsPageContainer.vue'),
              },
            ],
          },
          {
            path: '/customer',
            name: 'customer',
            children: [
              {
                path: '/customer',
                name: 'customerPage',
                component: () =>
                  import('@/views/crm/customer/CustomerPageContainer.vue'),
              },
            ],
          },
        ],
      },
    ],
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/LoginPage.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
})

export default router
